<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/taglib.jsp"%>
<script type="text/javascript">
	function showPassword(){
		$("input[name=password]").attr("type","text");
		$("input[value='显示密码']").hide();
		$("input[value='隐藏密码']").show();
	}

	function hidePassword(){
		$("input[name=password]").attr("type","password");
		$("input[value='显示密码']").show();
		$("input[value='隐藏密码']").hide();
	}
</script>
<input type="hidden" name="id" value="${user.id}" />
<input type="hidden" name="userId" value="${user.id}" />
<p>
	<label>用户名：</label> <input type="text" name="username" value="${user.username}" />
</p>
<p>
	<label>密码：</label> <input type="password" name="password" /><input type="button" value="显示密码" onclick="showPassword()"/><input type="button" value="隐藏密码" onclick="hidePassword()" style="display: none;"/>
</p>
<p>
	<label>角色：</label>
	<c:forEach var="role" items="${roles}">
		<c:choose>
			<c:when test="${role.used}">
				<input type="checkbox" name="roleIds" value="${role.id}"
					checked="checked" />
			</c:when>
			<c:otherwise>
				<input type="checkbox" name="roleIds" value="${role.id}" />
			</c:otherwise>
		</c:choose>
		<c:out value="${role.cnname}" />
	</c:forEach>
</p>
<input type="submit" value="保存" />
<input type="button" value="返回" class="fn-back" />
<hs:validator className="org.projectname.entity.manager.UserRole" />